package com.ljm.boot.rabbitmq.comsumer;

import com.ljm.boot.rabbitmq.constant.*;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

/**
 * 消息接收者
 */
@Service
public class TopicConsumer {

    @RabbitListener(queues = RabbitMQConstant.TOPIC_QUEUE_1)
    public void queue_topic1(Object msg) {
        System.out.println("从 queue_topic01 接收消息-" + msg);
    }

    @RabbitListener(queues = RabbitMQConstant.TOPIC_QUEUE_2)
    public void queue_topic2(Object msg) {
        System.out.println("从 queue_topic02 接收消息-" + msg);
    }
}
